<?php

namespace app\adminapi\controller\v1\finance;

use app\adminapi\controller\AuthController;
use app\adminapi\export\FinanceOrderExport;
use app\services\order\OrderService;

class Order extends AuthController
{
    public function index()
    {
        $where = $this->request->getMore([
            ['start_time', 0],
            ['end_time', 0],
            ['limit', 20],
            ['page', 1],
            ['sn', ''],
        ]);
        return app('json')->success((new OrderService())->getFinanceList($where));
    }

    public function export()
    {
        $where = $this->request->getMore([
            ['start_time', 0],
            ['end_time', 0],
            ['limit', 20],
            ['page', 1],
            ['sn', ''],
        ]);
        return app()->make(FinanceOrderExport::class)->export($where);
    }
}